package com.gopay.common.gateway.manager.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gopay.common.domain.pg.PgGenOrderTransDtl;
import com.gopay.common.domain.pg.PgGsrtOrderTransDtl;
import com.gopay.common.domain.pg.PgP2pOrderTransDtl;
import com.gopay.common.gateway.dao.PgGsrtOrderTransDtlQueryDAO;
import com.gopay.common.gateway.manager.PgGsrtOrderTransDtlQueryManager;

/**
 * @PgP2pOrderTransDtlQueryManagerImpl.java
 * @author fanghw
 * @2014-4-18 下午5:03:50  www.gopay.com.cn Inc.All rights reserved.
 */
@Service("pgGsrtOrderTransDtlQueryManager")
public class PgGsrtOrderTransDtlQueryManagerImpl implements PgGsrtOrderTransDtlQueryManager {
    
    @Resource(name = "pgGsrtOrderTransDtlQueryDAO")
    private PgGsrtOrderTransDtlQueryDAO pgGsrtOrderTransDtlQueryDAO;
    
    @Override
    public PgGsrtOrderTransDtl get(Serializable id) {
        // TODO Auto-generated method stub
        return pgGsrtOrderTransDtlQueryDAO.find(PgGsrtOrderTransDtl.class, id);
    }

    @Override
    public List<PgGsrtOrderTransDtl> get(Map<Object, Object> paraMap) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<PgGsrtOrderTransDtl> getAll() {
        // TODO Auto-generated method stub
        return pgGsrtOrderTransDtlQueryDAO.findAll(PgGsrtOrderTransDtl.class);
    }
    @Override
    @Transactional
    public void  update(PgGsrtOrderTransDtl  dtl) {
    	// TODO Auto-generated method stub
    	 pgGsrtOrderTransDtlQueryDAO.update(dtl);
    }
    @Override
    public  List<PgGsrtOrderTransDtl>  getlistMerOrderId(String merCustId, String merOrderId){
    	String hql="from PgGsrtOrderTransDtl where  merId=:merId and merOrderId=:merOrderId";
    	Map<String,Object> map=new HashMap<String, Object>();
    	map.put("merId", merCustId);
    	map.put("merOrderId", merOrderId);
   	 List<PgGsrtOrderTransDtl> list= pgGsrtOrderTransDtlQueryDAO.findByHql(hql, map);
   	 return  list;
    	
    }

    

}
